/* 游戏基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #1a1a1a;
    color: #fff;
    overflow: hidden;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #2c1810, #1a0f0a);
}

#gameCanvas {
    border: 3px solid #555;
    background: #000;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    width: 1000px;
    height: 750px;
}

/* 游戏UI */
#gameUI {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
    font-family: 'Courier New', monospace;
}

/* 血量条 */
#healthBar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(40, 40, 40, 0.95));
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #4a4a4a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.bar-label {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

.health-bar-container {
    width: 160px;
    height: 18px;
    background: linear-gradient(90deg, #2a2a2a, #1a1a1a);
    border: 2px solid #666;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.health-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6b6b, #ff8e53);
    transition: width 0.4s ease;
    width: 100%;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
    position: relative;
}

.health-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    border-radius: 2px 2px 0 0;
}

#healthText {
    color: #fff;
    font-weight: bold;
    min-width: 70px;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* 武器信息 */
#weaponInfo {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(40, 40, 40, 0.95));
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #4a4a4a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.weapon-icon {
    font-size: 18px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));
}

#ammoCount {
    color: #ffd700;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

/* 战斗模式信息 */
#combatMode {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(40, 40, 40, 0.95));
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #4a4a4a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.combat-mode-label {
    color: #00ff88;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
    letter-spacing: 1px;
}

#combatModeDisplay {
    color: #ffd700;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    letter-spacing: 1px;
}

.combat-mode-hint {
    color: #aaa;
    font-size: 9px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* 关卡和分数信息 */
#levelInfo, #score {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(40, 40, 40, 0.95));
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #4a4a4a;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    color: #fff;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

#levelInfo span, #score span {
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

#scoreValue, #currentLevel {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* 菜单样式 */
.menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, 
        rgba(15, 15, 15, 0.98), 
        rgba(25, 25, 25, 0.98)
    );
    padding: 50px 40px;
    border-radius: 15px;
    border: 3px solid #555;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: center;
    min-width: 450px;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.menu.hidden {
    display: none;
}

.menu h1 {
    color: #ff6b6b;
    font-size: 32px;
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.6),
                 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53, #ffb347);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}


.menu h2 {
    color: #ff8e53;
    font-size: 26px;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(255, 142, 83, 0.6),
                 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.menu p {
    margin-bottom: 25px;
    line-height: 1.8;
    color: #ddd;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.menu-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53, #ffb347);
    color: white;
    border: none;
    padding: 15px 35px;
    margin: 12px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    font-family: 'Courier New', monospace;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    transition: left 0.6s ease;
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    filter: brightness(1.1);
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.controls-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.controls-info h3 {
    color: #fff;
    margin-bottom: 15px;
}

.controls-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #aaa;
}

/* 像素风格字体 */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

.pixel-font {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 成就系统样式 */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.95));
    color: #000;
    padding: 20px 25px;
    border-radius: 12px;
    border: 2px solid #ffd700;
    box-shadow: 0 15px 35px rgba(255, 215, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 9999;
    min-width: 320px;
    max-width: 400px;
    animation: slideIn 0.6s ease-out;
    backdrop-filter: blur(10px);
}

.achievement-notification.hide {
    animation: slideOut 0.6s ease-in;
}

.achievement-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.achievement-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: bounce 0.8s ease-out;
}

.achievement-text h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: bold;
    color: #8B4513;
}

.achievement-text h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: bold;
    color: #000;
}

.achievement-text p {
    margin: 0;
    font-size: 12px;
    color: #333;
    opacity: 0.8;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
}

.achievement-card {
    background: linear-gradient(135deg, rgba(40, 40, 40, 0.95), rgba(60, 60, 60, 0.95));
    border: 2px solid #555;
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card.unlocked {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(60, 60, 60, 0.95));
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.achievement-card.unlocked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 2s infinite;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.achievement-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.achievement-card-icon {
    font-size: 36px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.achievement-card.unlocked .achievement-card-icon {
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.achievement-status {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.achievement-card.unlocked .achievement-status {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.achievement-card-name {
    color: #fff;
    font-size: 18px;
    margin: 0 0 10px 0;
    font-weight: bold;
}

.achievement-card-description {
    color: #ccc;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 15px;
}

.achievement-progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
}

.achievement-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ff8e53, #ffd700);
    transition: width 0.5s ease;
}

.achievement-card.unlocked .achievement-progress-fill {
    background: linear-gradient(90deg, #ffd700, #ffed4a, #ffd700);
}

.achievement-progress-text {
    font-size: 12px;
    color: #ccc;
    text-align: center;
}

.achievement-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.achievement-stat {
    text-align: center;
}

.achievement-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    display: block;
    margin-bottom: 5px;
}

.achievement-stat-label {
    font-size: 12px;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 动画效果 */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes glow {
    0% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
    100% { text-shadow: 0 0 30px rgba(255, 255, 255, 0.8); }
}

/* 增强的菜单动画 */
.menu {
    /* 移除动画，直接显示 */
}

.menu.hidden {
    /* 移除动画，直接隐藏 */
}

/* 增强的按钮效果 */
.menu-btn {
    position: relative;
    overflow: hidden;
    transform: perspective(1000px) rotateX(0deg);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.menu-btn:hover {
    transform: perspective(1000px) rotateX(-5deg) translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(255, 107, 107, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 107, 107, 0.3);
    filter: brightness(1.1) saturate(1.2);
}

.menu-btn:active {
    transform: perspective(1000px) rotateX(5deg) translateY(-1px) scale(0.98);
    box-shadow: 
        0 4px 15px rgba(255, 107, 107, 0.4),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.menu-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2), transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.menu-btn:active::after {
    width: 300px;
    height: 300px;
}

/* 按钮发光效果 */
.menu-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53, #ffb347, #ff6b6b);
    background-size: 300% 300%;
    border-radius: 10px;
    opacity: 0;
    z-index: -1;
    animation: buttonGlow 3s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

.menu-btn:hover::before {
    opacity: 0.7;
}

@keyframes buttonGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 游戏界面增强 */
#gameUI {
    animation: slideIn 0.8s ease-out;
}

#gameUI > div {
    animation: fadeIn 0.6s ease-out;
}

#gameUI > div:nth-child(1) { animation-delay: 0.1s; }
#gameUI > div:nth-child(2) { animation-delay: 0.2s; }
#gameUI > div:nth-child(3) { animation-delay: 0.3s; }
#gameUI > div:nth-child(4) { animation-delay: 0.4s; }

/* 血量条动画增强 */
.health-bar-fill {
    animation: pulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.health-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent
    );
    animation: healthSweep 3s linear infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 
            0 0 10px rgba(255, 107, 107, 0.5),
            inset 0 0 10px rgba(255, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 20px rgba(255, 107, 107, 0.8),
            inset 0 0 20px rgba(255, 255, 255, 0.2);
    }
}

@keyframes healthSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 武器信息增强 */
.weapon-icon {
    animation: weaponGlow 3s infinite;
    position: relative;
    display: inline-block;
}

.weapon-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent 70%);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: weaponPulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes weaponGlow {
    0%, 100% { 
        text-shadow: 
            0 0 8px rgba(255, 215, 0, 0.8),
            0 0 16px rgba(255, 215, 0, 0.6),
            0 0 24px rgba(255, 215, 0, 0.4);
    }
    50% { 
        text-shadow: 
            0 0 15px rgba(255, 215, 0, 1),
            0 0 30px rgba(255, 215, 0, 0.8),
            0 0 45px rgba(255, 215, 0, 0.6);
    }
}

@keyframes weaponPulse {
    0%, 100% { 
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* 分数和等级信息增强 */
#scoreValue, #currentLevel {
    animation: scoreGlow 2s infinite;
    position: relative;
    display: inline-block;
}

#scoreValue::before, #currentLevel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    animation: scoreSweep 3s linear infinite;
    border-radius: 4px;
}

@keyframes scoreGlow {
    0%, 100% { 
        text-shadow: 
            0 0 8px rgba(255, 215, 0, 0.6),
            0 0 16px rgba(255, 215, 0, 0.4);
    }
    50% { 
        text-shadow: 
            0 0 15px rgba(255, 215, 0, 1),
            0 0 30px rgba(255, 215, 0, 0.8);
    }
}

@keyframes scoreSweep {
    0% { transform: translateX(-100%) skewX(-45deg); }
    100% { transform: translateX(200%) skewX(-45deg); }
}

/* 增强的游戏画布效果 */
#gameCanvas {
    transition: all 0.3s ease;
    position: relative;
}

#gameCanvas:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 107, 107, 0.3);
    transform: translateY(-2px);
}

#gameCanvas::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #ff6b6b, #ff8e53, #ffb347, #ff6b6b);
    background-size: 400% 400%;
    border-radius: 13px;
    z-index: -1;
    opacity: 0;
    animation: canvasGlow 4s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

#gameCanvas:hover::before {
    opacity: 0.6;
}

@keyframes canvasGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 增强的容器效果 */
#gameContainer {
    position: relative;
    overflow: hidden;
}

#gameContainer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 142, 83, 0.1) 0%, transparent 50%);
    animation: ambientGlow 8s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes ambientGlow {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

/* 增强的UI动画 */
#gameUI > div {
    position: relative;
    overflow: hidden;
}

#gameUI > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent
    );
    animation: uiSweep 4s linear infinite;
    z-index: -1;
}

@keyframes uiSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 增强的血量条效果 */
#healthBar {
    position: relative;
    overflow: hidden;
}

#healthBar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(255, 107, 107, 0.8), 
        rgba(255, 107, 107, 0.3)
    );
    animation: healthIndicator 2s ease-in-out infinite;
}

@keyframes healthIndicator {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 增强的武器信息效果 */
#weaponInfo {
    position: relative;
    overflow: hidden;
}

#weaponInfo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 215, 0, 0.6), 
        transparent
    );
    animation: weaponScan 3s linear infinite;
}

@keyframes weaponScan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 增强的菜单过渡效果 */
.menu {
    overflow: hidden;
}

.menu::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 107, 107, 0.1), transparent);
    animation: menuRotate 10s linear infinite;
    z-index: -1;
}

@keyframes menuRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 增强的菜单标题效果 */
.menu h1 {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.menu h1::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent
    );
    animation: titleShine 3s ease-in-out infinite;
}

@keyframes titleShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 增强的按钮粒子效果 */
.menu-btn {
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 0.4) 30%, 
        transparent 70%
    );
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
    z-index: -1;
}

.menu-btn:hover::before {
    width: 300px;
    height: 300px;
}

.menu-btn:active::before {
    width: 400px;
    height: 400px;
    transition: all 0.1s ease;
}

/* 增强的成就通知效果 */
.achievement-notification {
    position: relative;
    overflow: hidden;
}

.achievement-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    animation: notificationShine 2s ease-in-out infinite;
}

@keyframes notificationShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 增强的技能树效果 */
.skill-tree {
    position: relative;
    overflow: hidden;
}

.skill-tree::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 107, 107, 0.05) 50%, 
        transparent 70%
    );
    animation: skillTreePulse 4s ease-in-out infinite;
}

@keyframes skillTreePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* 增强的技能节点效果 */
.skill-node {
    position: relative;
    overflow: hidden;
}

.skill-node::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent
    );
    transition: left 0.6s ease;
}

.skill-node:hover::before {
    left: 100%;
}

.skill-node.available::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(0, 255, 136, 0.1), 
        transparent
    );
    animation: availableGlow 2s ease-in-out infinite;
}

@keyframes availableGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 增强的学习按钮效果 */
.learn-skill-btn {
    position: relative;
    overflow: hidden;
}

.learn-skill-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.6), 
        transparent 70%
    );
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.learn-skill-btn:hover::before {
    width: 200px;
    height: 200px;
}

.learn-skill-btn:active::before {
    width: 250px;
    height: 250px;
    transition: all 0.1s ease;
}

/* 增强的滚动条效果 */
.skill-tree-menu::-webkit-scrollbar-thumb,
.skill-trees::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    border-radius: 10px;
    position: relative;
}

.skill-tree-menu::-webkit-scrollbar-thumb:hover,
.skill-trees::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff8e53, #ffb347);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* 页面加载动画 */
@keyframes pageLoad {
    0% { 
        opacity: 0;
        transform: scale(0.9) rotate(5deg);
        filter: blur(10px);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02) rotate(-2deg);
        filter: blur(2px);
    }
    100% { 
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0px);
    }
}

/* 页面切换动画 */
@keyframes pageTransition {
    0% { 
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateX(-50px) scale(0.95);
    }
    100% { 
        opacity: 0;
        transform: translateX(-100px) scale(0.9);
    }
}

/* 菜单项悬停特效 */
.menu-item {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    transition: left 0.6s ease;
}

.menu-item:hover::before {
    left: 100%;
}

/* 加载旋转动画 */
@keyframes loadingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 107, 107, 0.3);
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    animation: loadingSpin 1s linear infinite;
}

/* 进度条动画 */
@keyframes progressFill {
    0% { width: 0%; }
    100% { width: var(--progress-width); }
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ff8e53, #ffd700);
    animation: progressFill 1s ease-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent
    );
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 弹出窗口动画 */
@keyframes popupShow {
    0% { 
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(0);
    }
    100% { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes popupHide {
    0% { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% { 
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
}

.popup {
    animation: popupShow 0.4s ease-out;
}

.popup.hiding {
    animation: popupHide 0.3s ease-in;
}

/* 通知滑入动画 */
@keyframes notificationSlide {
    0% { 
        transform: translateX(400px);
        opacity: 0;
    }
    100% { 
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    0% { 
        transform: translateX(0);
        opacity: 1;
    }
    100% { 
        transform: translateX(400px);
        opacity: 0;
    }
}

.notification {
    animation: notificationSlide 0.5s ease-out;
}

.notification.hiding {
    animation: notificationSlideOut 0.3s ease-in;
}

/* 悬浮动画 */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* 呼吸动画 */
@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.breathing {
    animation: breathe 2s ease-in-out infinite;
}

/* 打字机效果 */
@keyframes typewriter {
    0% { width: 0; }
    100% { width: 100%; }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid #ff6b6b;
    white-space: nowrap;
    animation: typewriter 1s steps(20, end);
}

/* 闪烁光标 */
@keyframes blink {
    0%, 50% { border-color: transparent; }
    51%, 100% { border-color: #ff6b6b; }
}

.blinking-cursor {
    animation: blink 1s infinite;
}

/* 波浪动画 */
@keyframes wave {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

.wave {
    animation: wave 2s ease-in-out infinite;
    transform-origin: 70% 70%;
    display: inline-block;
}

/* 震动动画 */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* 弹性动画 */
@keyframes elastic {
    0% { transform: scale(1); }
    30% { transform: scale(1.25); }
    40% { transform: scale(0.75); }
    50% { transform: scale(1.15); }
    65% { transform: scale(0.95); }
    75% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.elastic {
    animation: elastic 0.8s ease-out;
}

/* 特效增强类 */
.enhanced-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.enhanced-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent
    );
    transition: left 0.6s ease;
}

.enhanced-button:hover::before {
    left: 100%;
}

.enhanced-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* 游戏界面增强 */
.game-interface {
    position: relative;
    overflow: hidden;
}

.game-interface::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 40%, 
        rgba(255, 107, 107, 0.05) 50%, 
        transparent 60%
    );
    animation: interfacePulse 4s ease-in-out infinite;
    z-index: -1;
}

@keyframes interfacePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* 页面初始化动画 */
body {
    animation: pageLoad 1s ease-out;
}

/* 游戏容器增强 */
#gameContainer {
    animation: pageLoad 1.2s ease-out;
}

/* 应用增强效果到现有元素 */
.menu-btn:hover {
    animation: elastic 0.6s ease-out;
}

/* 成就卡片增强动画 */
.achievement-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.achievement-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.achievement-card.unlocked {
    animation: unlockedPulse 2s ease-in-out infinite;
}

@keyframes unlockedPulse {
    0%, 100% { 
        box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
    }
    50% { 
        box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4);
    }
}

/* 技能点通知增强 */
.skill-point-notification {
    position: relative;
    overflow: hidden;
}

.skill-point-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    animation: notificationSweep 2s ease-in-out infinite;
}

@keyframes notificationSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 伤害数字增强 */
.damage-number {
    position: fixed;
    font-weight: bold;
    font-size: 18px;
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 9999;
    pointer-events: none;
    animation: damageFloat 1.5s ease-out;
}

@keyframes damageFloat {
    0% { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-30px) scale(1.2);
    }
    100% { 
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

/* 连击文字增强 */
.combo-text {
    position: fixed;
    font-weight: bold;
    font-size: 24px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 9999;
    pointer-events: none;
    animation: comboPop 1s ease-out;
}

@keyframes comboPop {
    0% { 
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    30% {
        opacity: 1;
        transform: scale(1.3) rotate(5deg);
    }
    100% { 
        opacity: 0;
        transform: scale(1) rotate(0deg);
    }
}

/* 武器信息增强动画 */
#weaponInfo:hover {
    animation: weaponInfoGlow 0.5s ease-out;
}

@keyframes weaponInfoGlow {
    0% { 
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    }
    50% {
        box-shadow: 
            0 8px 25px rgba(255, 215, 0, 0.4),
            0 4px 12px rgba(0, 0, 0, 0.6);
    }
    100% { 
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    }
}

/* 血量条危险状态 */
.health-bar-fill.danger {
    animation: dangerPulse 0.5s ease-in-out infinite;
}

@keyframes dangerPulse {
    0%, 100% { 
        background: linear-gradient(90deg, #ff4444, #ff6b6b, #ff8e53);
    }
    50% { 
        background: linear-gradient(90deg, #ff0000, #ff4444, #ff6b6b);
    }
}

/* 游戏结束动画 */
.game-over {
    animation: gameOverSlide 1s ease-out;
}

@keyframes gameOverSlide {
    0% { 
        opacity: 0;
        transform: translateY(-100px) scale(0.8);
    }
    100% { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 胜利动画 */
.victory {
    animation: victoryZoom 1s ease-out;
}

@keyframes victoryZoom {
    0% { 
        opacity: 0;
        transform: scale(0.5) rotate(-180deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(0deg);
    }
    100% { 
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* 关卡过渡动画 */
.level-transition {
    animation: levelTransition 2s ease-in-out;
}

@keyframes levelTransition {
    0% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0;
        transform: scale(1.1);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

/* 粒子效果容器 */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9997;
}

/* 星星背景动画 */
@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.star {
    position: fixed;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

/* 环境光效 */
.ambient-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, 
        rgba(255, 107, 107, 0.1) 0%, 
        transparent 70%
    );
    animation: ambientPulse 6s ease-in-out infinite;
    z-index: -2;
}

@keyframes ambientPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}
}

/* 增强的滚动条效果 */
.skill-tree-menu::-webkit-scrollbar-thumb,
.skill-trees::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    border-radius: 10px;
    position: relative;
}

.skill-tree-menu::-webkit-scrollbar-thumb:hover,
.skill-trees::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff8e53, #ffb347);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* 增强的加载动画 */
@keyframes loadingPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.loading-indicator {
    animation: loadingPulse 1.5s ease-in-out infinite;
}

/* 增强的错误提示效果 */
.skill-error-message {
    position: relative;
    overflow: hidden;
}

.skill-error-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    animation: errorShine 0.8s ease-in-out;
}

@keyframes errorShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 增强的成就卡片效果 */
.achievement-card {
    position: relative;
    overflow: hidden;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 107, 107, 0.3), 
        transparent
    );
    border-radius: 17px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.achievement-card:hover::before {
    opacity: 1;
}

.achievement-card.unlocked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 215, 0, 0.1) 50%, 
        transparent 70%
    );
    animation: unlockedShimmer 3s ease-in-out infinite;
}

@keyframes unlockedShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    /* 在小屏幕上减少动画复杂度 */
    .menu-btn:hover {
        animation: none;
        transform: translateY(-2px);
    }
    
    .achievement-card:hover {
        transform: translateY(-4px);
    }
    
    /* 简化粒子效果 */
    .particles-container {
        display: none;
    }
    
    /* 减少阴影和滤镜效果 */
    #gameCanvas::before {
        display: none;
    }
    
    .ambient-light {
        display: none;
    }
    #gameCanvas {
        width: 90vw;
        height: auto;
        max-width: 1000px;
    }
    
    .menu {
        min-width: 350px;
        padding: 40px 30px;
    }
    
    #gameUI {
        flex-direction: column;
        gap: 10px;
        top: 10px;
        left: 10px;
        right: 10px;
    }
    
    .achievement-grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    
    .achievement-notification {
        right: 10px;
        top: 10px;
        min-width: 280px;
    }
}